import React, { PureComponent } from 'react'
import { connect } from 'react-redux'

export class Profile extends PureComponent {
  render() {
    const { banners, recommends } = this.props
    
    return (
      <div>
        <h3>Profile Page</h3>
        <ul>
          {
            banners.map((item) => (
              <li key={item.acm}>{item.title}</li>
            ))
          }
        </ul>
        <ul>
          {
            recommends.map((item) => (
              <li key={item.acm}>{item.title}</li>
            ))
          }
        </ul>
      </div>
    )
  }
}

const mapStateToProps = (state) => ({
  banners: state.home.banners,
  recommends: state.home.recommends
})

export default connect(mapStateToProps)(Profile)